package bean;

import lombok.*;

import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

/**
 * @classname:Memeber
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/31 17:10
 * @version: 0.1
 * @since:1.8
 */
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class Member {
    private Integer mid;
    private String mname;
    private String pass;
    private String image;
    private String contact;
    private Float points;
    private BigDecimal balance;
    private Date create_time;
    private Date update_time;

    public Member(ResultSet rs) {
        try {
            this.mid = rs.getInt("mid");
            this.mname = rs.getString("mname");
            this.pass = rs.getString("pass");
            this.image = rs.getString("image");
            this.contact = rs.getString("contact");
            this.points = rs.getFloat("points");
            this.balance = rs.getBigDecimal("balance");
            this.create_time = (Date) rs.getObject("create_time");
            this.update_time = (Date) rs.getObject("update_time");
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
